
pkgname=iputils
pkgver=20161105
pkgrel=2
pkgdesc="IP Configuration Utilities (and Ping)."
arch=('x86_64')
license=('GPL')
url="http://www.linuxfoundation.org/en/Net:Iputils"
groups=('base')
depends=('glibc' 'openssl' 'sysfsutils' 'libcap' 'libidn')
makedepends=('libxslt' 'opensp')
backup=(etc/xinetd.d/tftp)
install=${pkgname}.install
source=("https://github.com/iputils/iputils/archive/s${pkgver}.tar.gz"
        'tftp.xinetd')
md5sums=('06f0be2dabe10dc80fdb328073230e69'
         'b5f1b81ea53983c402a46e85501858b3')

build() {
  cd ${pkgname}-s${pkgver}

  make USE_GNUTLS=no CCOPTOPT="$CFLAGS"
}

package() {
  cd ${pkgname}-s${pkgver}

  install -dm755 ${pkgdir}/usr/{bin,sbin} ${pkgdir}/bin

  install -m755 arping clockdiff rarpd rdisc tftpd tracepath traceroute6 \
    ${pkgdir}/usr/sbin/

  install -m755 ping ${pkgdir}/usr/bin/
   ln -sf /usr/bin/ping  ${pkgdir}/bin/

  install -dm755 ${pkgdir}/etc/xinetd.d/
  install -m644 ${srcdir}/tftp.xinetd ${pkgdir}/etc/xinetd.d/tftp
}

